package com.jr.service.impl;

import com.jr.dao.BaseDataDao;
import com.jr.dao.impl.BaseDataDaoImpl;
import com.jr.entity.BaseData;
import com.jr.service.BaseDataService;

/**
 * @Function：
 * @Author 梁明哲
 * @Email 424577090@qq.com
 * @Package com.jr.service.impl
 * @Project InvoiceManage
 * @Date 2023-02-20 15:28:37
 */
public class BaseDataServiceImpl implements BaseDataService {
    private BaseDataDao baseDataDao = new BaseDataDaoImpl();
    /**
     * 根据企业id查询相关信息
     * @param enterpriseId 企业id
     * @return 返回baseData对象
     * @throws Exception
     */
    @Override
    public BaseData findOne(Integer enterpriseId) throws Exception {
        return baseDataDao.findAllByEnterpriseId(enterpriseId);
    }

    /**
     * 根据企业id更新数据
     * @param baseData对象
     * @return 返回Integer 大于1更新成功
     * @throws Exception
     */
    @Override
    public Integer updateBaseData(BaseData baseData) throws Exception {
        return baseDataDao.saveBaseData(baseData);
    }
}







